﻿using AutoMapper;
using crip.Dtos;
using crip.Models;

namespace crip.Profiles
{
    public class EventProfile:Profile
    {
        public EventProfile()
        {
            CreateMap<EventForCreationDto, Event>()
            .ForMember(
                dest => dest.Id,
                opt => opt.MapFrom(src => Guid.NewGuid())
            )
             .ForMember(
                dest => dest.CreateTime,
                opt => opt.MapFrom(src => DateTime.Now)
            ) ;
            CreateMap<Event, EventDto>();
            CreateMap<Area, AreaSimplifyDto>();
        }
    }
}
